// ----------> GENERATED FILE - DON'T TOUCH! <----------

// generator: ilarkesto.mda.legacy.generator.GwtEntityGenerator










package scrum.client.project;

import java.util.*;
import ilarkesto.core.logging.Log;
import scrum.client.common.*;
import ilarkesto.gwt.client.*;

public abstract class GScenario
            extends scrum.client.common.AScrumGwtEntity {

    protected scrum.client.Dao getDao() {
        return scrum.client.Dao.get();
    }

    public abstract boolean isEditable();

    public GScenario() {
    }

    public GScenario(Map data) {
        super(data);
        updateProperties(data);
    }

    public static final String ENTITY_TYPE = "scenario";

    @Override
    public final String getEntityType() {
        return ENTITY_TYPE;
    }

    // --- project ---

    private String projectId;

    public final scrum.client.project.Project getProject() {
        if (projectId == null) return null;
        return getDao().getProject(this.projectId);
    }

    public final boolean isProjectSet() {
        return projectId != null;
    }

    public final Scenario setProject(scrum.client.project.Project project) {
        String id = project == null ? null : project.getId();
        if (equals(this.projectId, id)) return (Scenario) this;
        this.projectId = id;
        propertyChanged("projectId", this.projectId);
        return (Scenario)this;
    }

    public final boolean isProject(scrum.client.project.Project project) {
        String id = project==null ? null : project.getId();
        return equals(this.projectId, id);
    }

    // --- number ---

    private int number ;

    public final int getNumber() {
        return this.number ;
    }

    public final Scenario setNumber(int number) {
        if (isNumber(number)) return (Scenario)this;
        this.number = number ;
        propertyChanged("number", this.number);
        return (Scenario)this;
    }

    public final boolean isNumber(int number) {
        return equals(this.number, number);
    }

    private transient NumberModel numberModel;

    public NumberModel getNumberModel() {
        if (numberModel == null) numberModel = createNumberModel();
        return numberModel;
    }

    protected NumberModel createNumberModel() { return new NumberModel(); }

    protected class NumberModel extends ilarkesto.gwt.client.editor.AIntegerEditorModel {

        @Override
        public String getId() {
            return "Scenario_number";
        }

        @Override
        public java.lang.Integer getValue() {
            return getNumber();
        }

        @Override
        public void setValue(java.lang.Integer value) {
            setNumber(value);
        }

            @Override
            public void increment() {
                setNumber(getNumber() + 1);
            }

            @Override
            public void decrement() {
                setNumber(getNumber() - 1);
            }

        @Override
        protected void onChangeValue(java.lang.Integer oldValue, java.lang.Integer newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- points ---

    private java.lang.Float points ;

    public final java.lang.Float getPoints() {
        return this.points ;
    }

    public final Scenario setPoints(java.lang.Float points) {
        if (isPoints(points)) return (Scenario)this;
        this.points = points ;
        propertyChanged("points", this.points);
        return (Scenario)this;
    }

    public final boolean isPoints(java.lang.Float points) {
        return equals(this.points, points);
    }

    private transient PointsModel pointsModel;

    public PointsModel getPointsModel() {
        if (pointsModel == null) pointsModel = createPointsModel();
        return pointsModel;
    }

    protected PointsModel createPointsModel() { return new PointsModel(); }

    protected class PointsModel extends ilarkesto.gwt.client.editor.AFloatEditorModel {

        @Override
        public String getId() {
            return "Scenario_points";
        }

        @Override
        public java.lang.Float getValue() {
            return getPoints();
        }

        @Override
        public void setValue(java.lang.Float value) {
            setPoints(value);
        }

        @Override
        protected void onChangeValue(java.lang.Float oldValue, java.lang.Float newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- remaining ---

    private java.lang.Float remaining ;

    public final java.lang.Float getRemaining() {
        return this.remaining ;
    }

    public final Scenario setRemaining(java.lang.Float remaining) {
        if (isRemaining(remaining)) return (Scenario)this;
        this.remaining = remaining ;
        propertyChanged("remaining", this.remaining);
        return (Scenario)this;
    }

    public final boolean isRemaining(java.lang.Float remaining) {
        return equals(this.remaining, remaining);
    }

    private transient RemainingModel remainingModel;

    public RemainingModel getRemainingModel() {
        if (remainingModel == null) remainingModel = createRemainingModel();
        return remainingModel;
    }

    protected RemainingModel createRemainingModel() { return new RemainingModel(); }

    protected class RemainingModel extends ilarkesto.gwt.client.editor.AFloatEditorModel {

        @Override
        public String getId() {
            return "Scenario_remaining";
        }

        @Override
        public java.lang.Float getValue() {
            return getRemaining();
        }

        @Override
        public void setValue(java.lang.Float value) {
            setRemaining(value);
        }

        @Override
        protected void onChangeValue(java.lang.Float oldValue, java.lang.Float newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- state ---

    private java.lang.String state ;

    public final java.lang.String getState() {
        return this.state ;
    }

    public final Scenario setState(java.lang.String state) {
        if (isState(state)) return (Scenario)this;
        this.state = state ;
        propertyChanged("state", this.state);
        return (Scenario)this;
    }

    public final boolean isState(java.lang.String state) {
        return equals(this.state, state);
    }

    private transient StateModel stateModel;

    public StateModel getStateModel() {
        if (stateModel == null) stateModel = createStateModel();
        return stateModel;
    }

    protected StateModel createStateModel() { return new StateModel(); }

    protected class StateModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_state";
        }

        @Override
        public java.lang.String getValue() {
            return getState();
        }

        @Override
        public void setValue(java.lang.String value) {
            setState(value);
        }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- priority ---

    private int priority ;

    public final int getPriority() {
        return this.priority ;
    }

    public final Scenario setPriority(int priority) {
        if (isPriority(priority)) return (Scenario)this;
        this.priority = priority ;
        propertyChanged("priority", this.priority);
        return (Scenario)this;
    }

    public final boolean isPriority(int priority) {
        return equals(this.priority, priority);
    }

    private transient PriorityModel priorityModel;

    public PriorityModel getPriorityModel() {
        if (priorityModel == null) priorityModel = createPriorityModel();
        return priorityModel;
    }

    protected PriorityModel createPriorityModel() { return new PriorityModel(); }

    protected class PriorityModel extends ilarkesto.gwt.client.editor.AIntegerEditorModel {

        @Override
        public String getId() {
            return "Scenario_priority";
        }

        @Override
        public java.lang.Integer getValue() {
            return getPriority();
        }

        @Override
        public void setValue(java.lang.Integer value) {
            setPriority(value);
        }

            @Override
            public void increment() {
                setPriority(getPriority() + 1);
            }

            @Override
            public void decrement() {
                setPriority(getPriority() - 1);
            }

        @Override
        protected void onChangeValue(java.lang.Integer oldValue, java.lang.Integer newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- criticism ---

    private java.lang.String criticism ;

    public final java.lang.String getCriticism() {
        return this.criticism ;
    }

    public final Scenario setCriticism(java.lang.String criticism) {
        if (isCriticism(criticism)) return (Scenario)this;
        this.criticism = criticism ;
        propertyChanged("criticism", this.criticism);
        return (Scenario)this;
    }

    public final boolean isCriticism(java.lang.String criticism) {
        return equals(this.criticism, criticism);
    }

    private transient CriticismModel criticismModel;

    public CriticismModel getCriticismModel() {
        if (criticismModel == null) criticismModel = createCriticismModel();
        return criticismModel;
    }

    protected CriticismModel createCriticismModel() { return new CriticismModel(); }

    protected class CriticismModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_criticism";
        }

        @Override
        public java.lang.String getValue() {
            return getCriticism();
        }

        @Override
        public void setValue(java.lang.String value) {
            setCriticism(value);
        }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- criticismValue ---

    private int criticismValue ;

    public final int getCriticismValue() {
        return this.criticismValue ;
    }

    public final Scenario setCriticismValue(int criticismValue) {
        if (isCriticismValue(criticismValue)) return (Scenario)this;
        this.criticismValue = criticismValue ;
        propertyChanged("criticismValue", this.criticismValue);
        return (Scenario)this;
    }

    public final boolean isCriticismValue(int criticismValue) {
        return equals(this.criticismValue, criticismValue);
    }

    private transient CriticismValueModel criticismValueModel;

    public CriticismValueModel getCriticismValueModel() {
        if (criticismValueModel == null) criticismValueModel = createCriticismValueModel();
        return criticismValueModel;
    }

    protected CriticismValueModel createCriticismValueModel() { return new CriticismValueModel(); }

    protected class CriticismValueModel extends ilarkesto.gwt.client.editor.AIntegerEditorModel {

        @Override
        public String getId() {
            return "Scenario_criticismValue";
        }

        @Override
        public java.lang.Integer getValue() {
            return getCriticismValue();
        }

        @Override
        public void setValue(java.lang.Integer value) {
            setCriticismValue(value);
        }

            @Override
            public void increment() {
                setCriticismValue(getCriticismValue() + 1);
            }

            @Override
            public void decrement() {
                setCriticismValue(getCriticismValue() - 1);
            }

        @Override
        protected void onChangeValue(java.lang.Integer oldValue, java.lang.Integer newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- priorityValue ---

    private int priorityValue ;

    public final int getPriorityValue() {
        return this.priorityValue ;
    }

    public final Scenario setPriorityValue(int priorityValue) {
        if (isPriorityValue(priorityValue)) return (Scenario)this;
        this.priorityValue = priorityValue ;
        propertyChanged("priorityValue", this.priorityValue);
        return (Scenario)this;
    }

    public final boolean isPriorityValue(int priorityValue) {
        return equals(this.priorityValue, priorityValue);
    }

    private transient PriorityValueModel priorityValueModel;

    public PriorityValueModel getPriorityValueModel() {
        if (priorityValueModel == null) priorityValueModel = createPriorityValueModel();
        return priorityValueModel;
    }

    protected PriorityValueModel createPriorityValueModel() { return new PriorityValueModel(); }

    protected class PriorityValueModel extends ilarkesto.gwt.client.editor.AIntegerEditorModel {

        @Override
        public String getId() {
            return "Scenario_priorityValue";
        }

        @Override
        public java.lang.Integer getValue() {
            return getPriorityValue();
        }

        @Override
        public void setValue(java.lang.Integer value) {
            setPriorityValue(value);
        }

            @Override
            public void increment() {
                setPriorityValue(getPriorityValue() + 1);
            }

            @Override
            public void decrement() {
                setPriorityValue(getPriorityValue() - 1);
            }

        @Override
        protected void onChangeValue(java.lang.Integer oldValue, java.lang.Integer newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- label ---

    private java.lang.String label ;

    public final java.lang.String getLabel() {
        return this.label ;
    }

    public final Scenario setLabel(java.lang.String label) {
        if (isLabel(label)) return (Scenario)this;
        if (ilarkesto.core.base.Str.isBlank(label)) throw new RuntimeException("Field is mandatory.");
        this.label = label ;
        propertyChanged("label", this.label);
        return (Scenario)this;
    }

    public final boolean isLabel(java.lang.String label) {
        return equals(this.label, label);
    }

    private transient LabelModel labelModel;

    public LabelModel getLabelModel() {
        if (labelModel == null) labelModel = createLabelModel();
        return labelModel;
    }

    protected LabelModel createLabelModel() { return new LabelModel(); }

    protected class LabelModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_label";
        }

        @Override
        public java.lang.String getValue() {
            return getLabel();
        }

        @Override
        public void setValue(java.lang.String value) {
            setLabel(value);
        }

        @Override
        public boolean isMandatory() { return true; }

        @Override
        public boolean isEditable() { return GScenario.this.isEditable(); }
        @Override
        public String getTooltip() { return "The label should be short (as it appears where the Scenario is referenced), yet give a hint strong enough to make the content of it come to mind."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            if (oldValue == null) return;
            addUndo(this, oldValue);
        }

    }

    // --- stimulus ---

    private java.lang.String stimulus ;

    public final java.lang.String getStimulus() {
        return this.stimulus ;
    }

    public final Scenario setStimulus(java.lang.String stimulus) {
        if (isStimulus(stimulus)) return (Scenario)this;
        this.stimulus = stimulus ;
        propertyChanged("stimulus", this.stimulus);
        return (Scenario)this;
    }

    public final boolean isStimulus(java.lang.String stimulus) {
        return equals(this.stimulus, stimulus);
    }

    private transient StimulusModel stimulusModel;

    public StimulusModel getStimulusModel() {
        if (stimulusModel == null) stimulusModel = createStimulusModel();
        return stimulusModel;
    }

    protected StimulusModel createStimulusModel() { return new StimulusModel(); }

    protected class StimulusModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_stimulus";
        }

        @Override
        public java.lang.String getValue() {
            return getStimulus();
        }

        @Override
        public void setValue(java.lang.String value) {
            setStimulus(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "A condition that needs to be considered when it arrives at a system."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- sourceOfStimulus ---

    private java.lang.String sourceOfStimulus ;

    public final java.lang.String getSourceOfStimulus() {
        return this.sourceOfStimulus ;
    }

    public final Scenario setSourceOfStimulus(java.lang.String sourceOfStimulus) {
        if (isSourceOfStimulus(sourceOfStimulus)) return (Scenario)this;
        this.sourceOfStimulus = sourceOfStimulus ;
        propertyChanged("sourceOfStimulus", this.sourceOfStimulus);
        return (Scenario)this;
    }

    public final boolean isSourceOfStimulus(java.lang.String sourceOfStimulus) {
        return equals(this.sourceOfStimulus, sourceOfStimulus);
    }

    private transient SourceOfStimulusModel sourceOfStimulusModel;

    public SourceOfStimulusModel getSourceOfStimulusModel() {
        if (sourceOfStimulusModel == null) sourceOfStimulusModel = createSourceOfStimulusModel();
        return sourceOfStimulusModel;
    }

    protected SourceOfStimulusModel createSourceOfStimulusModel() { return new SourceOfStimulusModel(); }

    protected class SourceOfStimulusModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_sourceOfStimulus";
        }

        @Override
        public java.lang.String getValue() {
            return getSourceOfStimulus();
        }

        @Override
        public void setValue(java.lang.String value) {
            setSourceOfStimulus(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "The entity (an actor) that generated the stimulus."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- artifactStimulated ---

    private java.lang.String artifactStimulated ;

    public final java.lang.String getArtifactStimulated() {
        return this.artifactStimulated ;
    }

    public final Scenario setArtifactStimulated(java.lang.String artifactStimulated) {
        if (isArtifactStimulated(artifactStimulated)) return (Scenario)this;
        this.artifactStimulated = artifactStimulated ;
        propertyChanged("artifactStimulated", this.artifactStimulated);
        return (Scenario)this;
    }

    public final boolean isArtifactStimulated(java.lang.String artifactStimulated) {
        return equals(this.artifactStimulated, artifactStimulated);
    }

    private transient ArtifactStimulatedModel artifactStimulatedModel;

    public ArtifactStimulatedModel getArtifactStimulatedModel() {
        if (artifactStimulatedModel == null) artifactStimulatedModel = createArtifactStimulatedModel();
        return artifactStimulatedModel;
    }

    protected ArtifactStimulatedModel createArtifactStimulatedModel() { return new ArtifactStimulatedModel(); }

    protected class ArtifactStimulatedModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_artifactStimulated";
        }

        @Override
        public java.lang.String getValue() {
            return getArtifactStimulated();
        }

        @Override
        public void setValue(java.lang.String value) {
            setArtifactStimulated(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "Some system artifact is stimulated by the stimulus. This artifact may be the entire system or some portion of it."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- environment ---

    private java.lang.String environment ;

    public final java.lang.String getEnvironment() {
        return this.environment ;
    }

    public final Scenario setEnvironment(java.lang.String environment) {
        if (isEnvironment(environment)) return (Scenario)this;
        this.environment = environment ;
        propertyChanged("environment", this.environment);
        return (Scenario)this;
    }

    public final boolean isEnvironment(java.lang.String environment) {
        return equals(this.environment, environment);
    }

    private transient EnvironmentModel environmentModel;

    public EnvironmentModel getEnvironmentModel() {
        if (environmentModel == null) environmentModel = createEnvironmentModel();
        return environmentModel;
    }

    protected EnvironmentModel createEnvironmentModel() { return new EnvironmentModel(); }

    protected class EnvironmentModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_environment";
        }

        @Override
        public java.lang.String getValue() {
            return getEnvironment();
        }

        @Override
        public void setValue(java.lang.String value) {
            setEnvironment(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "The stimulus occurs within a specified context. For example, the system may be in a normal state, a degraded mode, or in an overload condition when the stimulus occurs."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- response ---

    private java.lang.String response ;

    public final java.lang.String getResponse() {
        return this.response ;
    }

    public final Scenario setResponse(java.lang.String response) {
        if (isResponse(response)) return (Scenario)this;
        this.response = response ;
        propertyChanged("response", this.response);
        return (Scenario)this;
    }

    public final boolean isResponse(java.lang.String response) {
        return equals(this.response, response);
    }

    private transient ResponseModel responseModel;

    public ResponseModel getResponseModel() {
        if (responseModel == null) responseModel = createResponseModel();
        return responseModel;
    }

    protected ResponseModel createResponseModel() { return new ResponseModel(); }

    protected class ResponseModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_response";
        }

        @Override
        public java.lang.String getValue() {
            return getResponse();
        }

        @Override
        public void setValue(java.lang.String value) {
            setResponse(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "The activity undertaken when the stimulus arrives."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- responseMeasure ---

    private java.lang.String responseMeasure ;

    public final java.lang.String getResponseMeasure() {
        return this.responseMeasure ;
    }

    public final Scenario setResponseMeasure(java.lang.String responseMeasure) {
        if (isResponseMeasure(responseMeasure)) return (Scenario)this;
        this.responseMeasure = responseMeasure ;
        propertyChanged("responseMeasure", this.responseMeasure);
        return (Scenario)this;
    }

    public final boolean isResponseMeasure(java.lang.String responseMeasure) {
        return equals(this.responseMeasure, responseMeasure);
    }

    private transient ResponseMeasureModel responseMeasureModel;

    public ResponseMeasureModel getResponseMeasureModel() {
        if (responseMeasureModel == null) responseMeasureModel = createResponseMeasureModel();
        return responseMeasureModel;
    }

    protected ResponseMeasureModel createResponseMeasureModel() { return new ResponseMeasureModel(); }

    protected class ResponseMeasureModel extends ilarkesto.gwt.client.editor.ATextEditorModel {

        @Override
        public String getId() {
            return "Scenario_responseMeasure";
        }

        @Override
        public java.lang.String getValue() {
            return getResponseMeasure();
        }

        @Override
        public void setValue(java.lang.String value) {
            setResponseMeasure(value);
        }

        @Override
        public boolean isRichtext() { return true; }
        @Override
        public String getTooltip() { return "When the response occurs, it should be measurable in some fashion, so the quality attribute requirement can be tested."; }

        @Override
        protected void onChangeValue(java.lang.String oldValue, java.lang.String newValue) {
            super.onChangeValue(oldValue, newValue);
            addUndo(this, oldValue);
        }

    }

    // --- qualitys ---

    private Set<String> qualitysIds = new HashSet<String>();

    public final java.util.Set<scrum.client.project.Quality> getQualitys() {
        if ( qualitysIds.isEmpty()) return Collections.emptySet();
        return getDao().getQualitys(this.qualitysIds);
    }

    public final void setQualitys(Collection<scrum.client.project.Quality> values) {
        qualitysIds = ilarkesto.gwt.client.Gwt.getIdsAsSet(values);
        propertyChanged("qualitysIds", this.qualitysIds);
    }

    public final void addQuality(scrum.client.project.Quality quality) {
        String id = quality.getId();
        if (qualitysIds.contains(id)) return;
        qualitysIds.add(id);
        propertyChanged("qualitysIds", this.qualitysIds);
    }

    public final void removeQuality(scrum.client.project.Quality quality) {
        String id = quality.getId();
        if (!qualitysIds.contains(id)) return;
        qualitysIds.remove(id);
        propertyChanged("qualitysIds", this.qualitysIds);
    }

    public final boolean containsQuality(scrum.client.project.Quality quality) {
        return qualitysIds.contains(quality.getId());
    }


    // --- storiesAssociates ---

    private Set<String> storiesAssociatesIds = new HashSet<String>();

    public final java.util.Set<scrum.client.project.Requirement> getStoriesAssociates() {
        if ( storiesAssociatesIds.isEmpty()) return Collections.emptySet();
        return getDao().getRequirements(this.storiesAssociatesIds);
    }

    public final void setStoriesAssociates(Collection<scrum.client.project.Requirement> values) {
        storiesAssociatesIds = ilarkesto.gwt.client.Gwt.getIdsAsSet(values);
        propertyChanged("storiesAssociatesIds", this.storiesAssociatesIds);
    }

    public final void addStoriesAssociate(scrum.client.project.Requirement storiesAssociate) {
        String id = storiesAssociate.getId();
        if (storiesAssociatesIds.contains(id)) return;
        storiesAssociatesIds.add(id);
        propertyChanged("storiesAssociatesIds", this.storiesAssociatesIds);
    }

    public final void removeStoriesAssociate(scrum.client.project.Requirement storiesAssociate) {
        String id = storiesAssociate.getId();
        if (!storiesAssociatesIds.contains(id)) return;
        storiesAssociatesIds.remove(id);
        propertyChanged("storiesAssociatesIds", this.storiesAssociatesIds);
    }

    public final boolean containsStoriesAssociate(scrum.client.project.Requirement storiesAssociate) {
        return storiesAssociatesIds.contains(storiesAssociate.getId());
    }


    // --- update properties by map ---

    public void updateProperties(Map props) {
        projectId = (String) props.get("projectId");
        number  = (Integer) props.get("number");
        points  = (java.lang.Float) props.get("points");
        remaining  = (java.lang.Float) props.get("remaining");
        state  = (java.lang.String) props.get("state");
        priority  = (Integer) props.get("priority");
        criticism  = (java.lang.String) props.get("criticism");
        criticismValue  = (Integer) props.get("criticismValue");
        priorityValue  = (Integer) props.get("priorityValue");
        label  = (java.lang.String) props.get("label");
        stimulus  = (java.lang.String) props.get("stimulus");
        sourceOfStimulus  = (java.lang.String) props.get("sourceOfStimulus");
        artifactStimulated  = (java.lang.String) props.get("artifactStimulated");
        environment  = (java.lang.String) props.get("environment");
        response  = (java.lang.String) props.get("response");
        responseMeasure  = (java.lang.String) props.get("responseMeasure");
        qualitysIds = (Set<String>) props.get("qualitysIds");
        storiesAssociatesIds = (Set<String>) props.get("storiesAssociatesIds");
        updateLocalModificationTime();
    }

    @Override
    public void storeProperties(Map properties) {
        super.storeProperties(properties);
        properties.put("projectId", this.projectId);
        properties.put("number", this.number);
        properties.put("points", this.points);
        properties.put("remaining", this.remaining);
        properties.put("state", this.state);
        properties.put("priority", this.priority);
        properties.put("criticism", this.criticism);
        properties.put("criticismValue", this.criticismValue);
        properties.put("priorityValue", this.priorityValue);
        properties.put("label", this.label);
        properties.put("stimulus", this.stimulus);
        properties.put("sourceOfStimulus", this.sourceOfStimulus);
        properties.put("artifactStimulated", this.artifactStimulated);
        properties.put("environment", this.environment);
        properties.put("response", this.response);
        properties.put("responseMeasure", this.responseMeasure);
        properties.put("qualitysIds", this.qualitysIds);
        properties.put("storiesAssociatesIds", this.storiesAssociatesIds);
    }

    public final java.util.List<scrum.client.project.Requirement> getRequirements() {
        return getDao().getRequirementsByRelatedScenario((Scenario)this);
    }

    @Override
    public boolean matchesKey(String key) {
        if (super.matchesKey(key)) return true;
        if (matchesKey(getLabel(), key)) return true;
        if (matchesKey(getStimulus(), key)) return true;
        if (matchesKey(getSourceOfStimulus(), key)) return true;
        if (matchesKey(getArtifactStimulated(), key)) return true;
        if (matchesKey(getEnvironment(), key)) return true;
        if (matchesKey(getResponse(), key)) return true;
        if (matchesKey(getResponseMeasure(), key)) return true;
        return false;
    }

}